//基础路径
const BASE_URL = "http://192.168.8.10:8088"


export const myRequest = (options) =>{
	return new Promise((resolve,reject)=>{
		uni.request({
			url:BASE_URL+options.url,
			methods:options.methods || "GET",
			data:options.data || {},
			success:((res)=>{
				if(res.statusCode !== 200){
					return uni.showToast({
						title:"获取数据失败"
					})
				}
				//成功返回结果
				resolve(res)
			}),
			fail:(err)=>{
				uni.showToast({
					title:"接口失败"
				})
				reject(err)
			}
		})
	})
}
